package org.jeecg.modules.mes.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Description: 生产计划工种任务表
 * @Author: jeecg-boot
 * @Date: 2025-01-21
 * @Version: V1.0
 */
@Data
@TableName("mes_production_plan_task")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="mes_production_plan_task对象", description="生产计划工种任务表")
public class MesProductionPlanTask implements Serializable {
    private static final long serialVersionUID = 1L;

    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    
    /**生产计划ID*/
    @Excel(name = "生产计划ID", width = 15)
    @ApiModelProperty(value = "生产计划ID")
    private String planId;
    
    /**工种ID*/
    @Excel(name = "工种ID", width = 15)
    @ApiModelProperty(value = "工种ID")
    private String workTypeId;
    
    /**工种编码*/
    @Excel(name = "工种编码", width = 15)
    @ApiModelProperty(value = "工种编码")
    private String workTypeCode;
    
    /**工种名称*/
    @Excel(name = "工种名称", width = 15)
    @ApiModelProperty(value = "工种名称")
    private String workTypeName;
    
    /**订单明细ID*/
    @Excel(name = "订单明细ID", width = 15)
    @ApiModelProperty(value = "订单明细ID")
    private String orderDetailId;
    
    /**订单编号*/
    @Excel(name = "订单编号", width = 15)
    @ApiModelProperty(value = "订单编号")
    private String orderNo;
    
    /**产品信息*/
    @Excel(name = "产品信息", width = 20)
    @ApiModelProperty(value = "产品信息(门窗系列-窗号-颜色)")
    private String productInfo;
    
    /**产品编码*/
    @Excel(name = "产品编码", width = 15)
    @ApiModelProperty(value = "产品编码")
    private String productCode;
    
    /**产品名称*/
    @Excel(name = "产品名称", width = 15)
    @ApiModelProperty(value = "产品名称")
    private String productName;
    
    /**产品规格*/
    @Excel(name = "产品规格", width = 20)
    @ApiModelProperty(value = "产品规格")
    private String productSpec;
    
    /**工序顺序*/
    @Excel(name = "工序顺序", width = 15)
    @ApiModelProperty(value = "工序顺序")
    private Integer sequence;
    
    /**任务数量*/
    @Excel(name = "任务数量", width = 15)
    @ApiModelProperty(value = "任务数量")
    private Integer taskQuantity;
    
    /**完成数量*/
    @Excel(name = "完成数量", width = 15)
    @ApiModelProperty(value = "完成数量")
    private Integer completedQuantity;

    
    /**计划开始日期*/
    @Excel(name = "计划开始日期", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "计划开始日期")
    private Date planStartDate;
    
    /**计划结束日期*/
    @Excel(name = "计划结束日期", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "计划结束日期")
    private Date planEndDate;
    
    /**实际开始日期*/
    @Excel(name = "实际开始日期", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "实际开始日期")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Date actualStartDate;
    
    /**实际结束日期*/
    @Excel(name = "实际结束日期", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "实际结束日期")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Date actualEndDate;

    /**完成率 */
    @Excel(name = "完成率%", width = 15)
    @ApiModelProperty(value = "完成率%")
    private BigDecimal completionRate;
    
    /**状态(0-待领取,1-已领取,2-进行中,3-已完成,4-暂停)*/
    @Excel(name = "状态", width = 15, dicCode = "task_status")
    @Dict(dicCode = "task_status")
    @ApiModelProperty(value = "状态(0-待领取,1-已领取,2-进行中,3-已完成,4-暂停)")
    private Integer status;

    /**计件标准 */
    @Excel(name = "计件标准", width = 15)
    @ApiModelProperty(value = "计件标准")
    private String pieceRateStandardId;
    
    /**协作类型(0-独立完成,1-协作完成,2-分段完成)*/
    @Excel(name = "协作类型", width = 15, dicCode = "collaboration_type")
    @ApiModelProperty(value = "协作类型(0-独立完成,1-协作完成,2-分段完成)")
    private Integer collaborationType;
    
    /**最大参与人数*/
    @Excel(name = "最大参与人数", width = 15)
    @ApiModelProperty(value = "最大参与人数")
    private Integer maxParticipants;
    
    /**当前参与人数*/
    @Excel(name = "当前参与人数", width = 15)
    @ApiModelProperty(value = "当前参与人数")
    private Integer currentParticipants;
    
    /**是否允许部分领取(0-否,1-是)*/
    @Excel(name = "是否允许部分领取", width = 15, dicCode = "yes_no")
    @ApiModelProperty(value = "是否允许部分领取(0-否,1-是)")
    private Integer allowPartialClaim;
    
    /**备注*/
    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;
    
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
    
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    
    /**更新日期*/
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
    
    /**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;

    /**
     * 租户ID（多租户支持）
     */
    @ApiModelProperty(value = "租户ID")
    private Integer tenantId;
    
    /**任务参与者列表（非数据库字段）*/
    @TableField(exist = false)
    @ApiModelProperty(value = "任务参与者列表")
    private List<MesTaskParticipant> participants;

    /**任务参与者列表（非数据库字段）*/
    @TableField(exist = false)
    @ApiModelProperty(value = "任务参与者名称")
    private String participantNames;

    /**领取员工ID（非数据库字段）*/
    @TableField(exist = false)
    @ApiModelProperty(value = "领取员工ID")
    private String claimedEmployeeId;

    private transient String planName;

    @ApiModelProperty(value = "单价标准")
    @TableField(exist = false)
    private String pieceRateStandard;
}
